using System;

namespace Microsoft.SqlServer.Management.SqlManagerUI.Scripting
{
	internal class ScriptWriterFactory
	{
		private string batchSeparator;

		private bool includeContext;

		private TextWriterProvider writerProvider;

		public ScriptWriterFactory(string batchSeparator, bool includeContext, TextWriterProvider writerProvider)
		{
			if (writerProvider == null)
			{
				throw new ArgumentNullException("writerProvider");
			}
			this.batchSeparator = batchSeparator;
			this.includeContext = includeContext;
			this.writerProvider = writerProvider;
		}

		public virtual ScriptWriter GetScriptWriter()
		{
			return new ScriptWriter(this.batchSeparator, this.includeContext, this.writerProvider);
		}
	}
}
